package com.vogue.supplymall.admin.business.domain.service.impl;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.admin.business.domain.dao.AdminPrivatePlatformDao;
import com.vogue.supplymall.admin.business.domain.model.AdminPrivatePlatform;
import com.vogue.supplymall.admin.business.domain.service.AdminPrivatePlatformService;
import com.vogue.supplymall.common.domain.dto.SearchInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * The type Admin private platform service.
 *
 * @author zhangliang
 * @date Create in 2018-07-09
 */
@Service("adminPrivatePlatformService")
public class AdminPrivatePlatformServiceImpl extends BaseServiceImpl<AdminPrivatePlatform, Long> implements AdminPrivatePlatformService {
    @Resource
    private AdminPrivatePlatformDao adminPrivatePlatformDao;

    /**
     * Instantiates a new Admin private platform service.
     *
     * @param baseDao the base dao
     */
    public AdminPrivatePlatformServiceImpl(BaseDao<AdminPrivatePlatform, Long> baseDao) {
        super(baseDao);
    }

    @Override
    public List<AdminPrivatePlatform> findByPrivatePlatformInfo(SearchInfo searchInfo) {
        if (null == searchInfo) {
            return new ArrayList<>();
        }
        return adminPrivatePlatformDao.getPrivatePlatformInfo(searchInfo.getTendId());
    }
}
